// NXTBrick.h : main header file for the NXTBrick DLL
//

#pragma once

#ifndef __AFXWIN_H__
	#error "include 'stdafx.h' before including this file for PCH"
#endif

#pragma warning(disable: 4251)


#include "bluetooth.h"
#include "brick.h"
#include "motor.h"

// CNXTBrickApp
// See NXTBrick.cpp for the implementation of this class
//

#ifdef NXT_BRICK_EXPORT
	#define NXT_Export_Flag __declspec (dllexport)
#else
	#define NXT_Export_Flag __declspec (dllimport)
#endif

class NXT_Export_Flag CNXTBrick
{
public:
	CNXTBrick();

	bool ConnectToComPort(int iComPort);

	// speed is from -100 to 100, zero is stop, sign is direction
	bool Drive(int iSpeedLeftMotor, int iSpeedRightMotor);
	bool Stop();

	bool Fire();

	bool SetMotorPorts(Motor_port portLeft, 
		Motor_port portRight, Motor_port portFire);

protected:

	Bluetooth	m_Bluetooth;
	Brick		m_Brick;

	Motor		m_LeftMotor;
	Motor		m_RightMotor;
	Motor		m_FireMotor;

	CString		m_strLastErrorMsg;
};

